package com.itheima_02;

import java.util.Scanner;

public class StudentDemo {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入学生信息：");
        String s = sc.nextLine();
        //根据逗号切割字符串
        String[] split = s.split("，");
        System.out.println(split[0]);
        System.out.println(split[1]);

        //从得到的字符串数组中取出元素内容，通过Student类的有参构造方法封装为对象
        Student stu = new Student(split[0],split[1]);

        //调用对象getXxx方法，取出数据并打印
        //System.out.println(stu.getName() + "，" + stu.getAge());
        stu.show();
    }
}
